//
//  NCChatUserInfoManager.h
//  AGEmojiKeyboard
//
//  Created by LINAICAI on 2018/4/19.
//

#import <Foundation/Foundation.h>
#import "NCChatUser.h"
@protocol NCChatUserInfoDataSource <NSObject>
@required
- (void)getUserWith:(NSString *)senderId completion:(void (^)(NCChatUser *))completion;
@end
@interface NCChatUserInfoManager : NSObject
///用户信息缓存,以防每次都要去服务器获取用户数据
@property (nonatomic , strong , readonly)NSMutableArray<NCChatUser*> *cacheUsers;
///数据源代理,决定了由谁来提供用户信息
@property (nonatomic , weak)id<NCChatUserInfoDataSource> delegate;
+ (instancetype)shared;
///更新用户缓存
- (void)refreshUserInfoCache:(NCChatUser *)userInfo;
///获取用户信息
- (NCChatUser *)getUserCache:(NSString *)senderId;
///清空用户信息缓存
- (void)clearUserInfoCache;
@end
